#!/bin/bash
VERSION="0.0.1"
export LANG="ja_JP.UTF-8"
_HOME=`dirname $0`
_CLASSPATH=`echo $(find ./lib -name "*.jar")| sed -e 's/ /:/g'`
echo $_CLASSPATH
echo $_HOME/src

if [ ! -d $_HOME/dest ]; then
  mkdir dest
fi

SOURCEFILES=`find $_HOME/src -name "*.java"`
echo $SOURCEFILES
javac -classpath $_CLASSPATH -d dest $SOURCEFILES
JARNAME="aws-account-activity-$VERSION.jar"
OPTION=""
if [ -f $JARNAME ]; then
  OPTION=" -uvf"
else 
  OPTION=" -cvf"
fi
pushd dest
jar $OPTION ../lib/$JARNAME ./
popd
